home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / games / nhak_src.zip / MONST.H < prev    next >
C/C++ Source or Header  |  1993-03-16  |  3KB  |  90 lines

  1. /*    SCCS Id: @(#)monst.h    3.0    88/04/15
  2. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  3. /* NetHack may be freely redistributed.  See license for details. */
  4.  
  5. #ifndef MONST_H
  6. #define MONST_H
  7.  
  8. struct monst {
  9.     struct monst *nmon;
  10.     struct permonst *data;
  11.     unsigned m_id;
  12.     uchar m_lev;        /* adjusted difficulty level of monster */
  13.     schar malign;        /* alignment of this monster, relative to the
  14.                    player (positive = good to kill) */
  15.     xchar mx, my;
  16.     xchar mux, muy;        /* where the monster thinks you are */
  17.     xchar mdx, mdy;        /* if mdispl then pos where last displayed */
  18. #define    MTSZ    4
  19.     coord mtrack[MTSZ];    /* monster track */
  20.     int mhp, mhpmax;
  21.     unsigned mappearance;    /* for undetected mimics and the wiz */
  22.     uchar     m_ap_type;    /* what mappearance is describing: */
  23. #define M_AP_NOTHING    0    /* mappearance is unused */
  24. #define M_AP_FURNITURE    1    /* stairs, a door, an altar, etc. */
  25. #define M_AP_OBJECT    2    /* an object */
  26. #define M_AP_MONSTER    3    /* a monster */
  27. #define M_AP_GOLD    4    /* a quantity (mappearance holds it) of gold */
  28.  
  29.     schar mtame;        /* level of tameness, implies peaceful */
  30.     int mspec_used;     /* monster's special ability attack timeout */
  31.  
  32.     Bitfield(mimic,1);    /* undetected mimic */
  33.     Bitfield(mdispl,1);    /* mdx,mdy valid */
  34.     Bitfield(minvis,1);    /* invisible */
  35.     Bitfield(cham,1);    /* shape-changer */
  36.     Bitfield(mhide,1);    /* hides beneath objects */
  37.     Bitfield(mundetected,1);    /* not seen in present hiding place */
  38.     Bitfield(mspeed,2);
  39.  
  40.     Bitfield(mflee,1);    /* fleeing */
  41.     Bitfield(mfleetim,7);    /* timeout for mflee */
  42.  
  43.     Bitfield(mcansee,1);    /* cansee 1, temp.blinded 0, blind 0 */
  44.     Bitfield(mblinded,7);    /* cansee 0, temp.blinded n, blind 0 */
  45.  
  46.     Bitfield(mcanmove,1);    /* paralysis, similar to mblinded */
  47.     Bitfield(mfrozen,7);
  48.  
  49.     Bitfield(msleep,1);    /* sleeping */
  50.     Bitfield(mstun,1);    /* stunned (off balance) */
  51.     Bitfield(mconf,1);    /* confused */
  52.     Bitfield(mcan,1);    /* has been cancelled */
  53.     Bitfield(mpeaceful,1);    /* does not attack unprovoked */
  54.     Bitfield(mtrapped,1);    /* trapped in a pit or bear trap */
  55.     Bitfield(mleashed,1);    /* monster is on a leash */
  56.     Bitfield(isshk,1);    /* is shopkeeper */
  57.  
  58.     Bitfield(isgd,1);    /* is guard */
  59. #if defined(ALTARS) && defined(THEOLOGY)
  60.     Bitfield(ispriest,1);    /* is a priest */
  61. #endif
  62.     Bitfield(iswiz,1);    /* is the Wizard of Yendor */
  63. #ifdef WORM
  64.     Bitfield(wormno,5);    /* at most 31 worms on any level */
  65. #endif
  66.  
  67.     long mtrapseen;        /* bitmap of traps we've been trapped in */
  68.     long mlstmv;        /* prevent two moves at once */
  69.     struct obj *minvent;
  70.     long mgold;
  71.     uchar mnamelth;        /* length of name (following mxlth) */
  72.     short mxlth;        /* length of following data */
  73.     /* in order to prevent alignment problems mextra should
  74.        be (or follow) a long int */
  75.     int meating;        /* monster is eating timeout */
  76.     long mextra[1];     /* monster dependent info */
  77. };
  78.  
  79. #define newmonst(xl)    (struct monst *) alloc((unsigned)(xl) + sizeof(struct monst))
  80.  
  81. extern struct monst *mydogs, *fallen_down;
  82.  
  83. /* these are in mspeed */
  84. #define MSLOW 1 /* slow monster */
  85. #define MFAST 2 /* speeded monster */
  86.  
  87. #define    NAME(mtmp)    (((char *) mtmp->mextra) + mtmp->mxlth)
  88.  
  89. #endif /* MONST_H /**/
  90.